/**
 * Segmented 组件的主题配置
 */

import type { ComponentToken } from 'antd/es/segmented/style';

const TRACK_TOKENS = {
  trackPadding: 2,
  trackBg: '#f5f5f5',
} as const;

const ITEM_TOKENS = {
  itemColor: '#8c8c8c',
  itemHoverColor: '#1a1a1a',
  itemHoverBg: '#e6f7ff',
  itemActiveBg: '#bae7ff',
  itemSelectedBg: '#ffffff',
  itemSelectedColor: '#1a1a1a',
} as const;

export const segmentedThemeConfig: Partial<ComponentToken> = {
  trackPadding: TRACK_TOKENS.trackPadding,
  trackBg: TRACK_TOKENS.trackBg,
  itemColor: ITEM_TOKENS.itemColor as any,
  itemHoverColor: ITEM_TOKENS.itemHoverColor as any,
  itemHoverBg: ITEM_TOKENS.itemHoverBg,
  itemActiveBg: ITEM_TOKENS.itemActiveBg,
  itemSelectedBg: ITEM_TOKENS.itemSelectedBg,
  itemSelectedColor: ITEM_TOKENS.itemSelectedColor as any,
};

export const getSegmentedTheme = (
  customConfig?: Partial<ComponentToken>
): Partial<ComponentToken> => {
  return {
    ...segmentedThemeConfig,
    ...customConfig,
  };
};

export type { ComponentToken as SegmentedComponentToken } from 'antd/es/segmented/style';

